package com.consumer.user.service;

import com.consumer.user.config.FullLogConfiguration;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;

import java.util.Map;

/**
 * 类描述：实现图片文件上传的实现
 *
 * @author linzf
 */
@FeignClient(value = "USER-CENTER-PRODUCE", configuration = FullLogConfiguration.class, path = "/file")
public interface ConsumerFileService {

    /**
     * 功能描述：实现文件上传,若是多个参数的时候需要加上以下的注释@RequestParam
     * @param file 文件上传的前置添加参数应该为RequestPart这样才可以正常的提交文件
     * @param idImageType
     * @return
     */
    @PostMapping(value = "uploadFile",consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    Map<String,Object> uploadFile(@RequestPart("file") MultipartFile file, @RequestParam("idImageType")String idImageType);

}
